package com.jiayang.module.station;

import com.jiayang.common.domain.ResponseDTO;
import com.jiayang.module.station.domain.dto.StationFindDTO;
import com.jiayang.module.station.domain.entity.StationEntity;
import com.jiayang.module.system.employee.domain.bo.EmployeeBO;
import com.jiayang.module.system.login.domain.RequestTokenBO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ Author     ：OuyangChenglong
 * @ Date       ：Created in 13:23 2021/9/7
 * @ Description：场站管理
 * @ Modified By：
 * @Version: 1.0$
 */
@Service
public class StationService {

    @Autowired
    private StationDao stationDao;

    public void getById(){
        StationEntity stationEntity = stationDao.selectById(1L);
        System.out.println(stationEntity);
    }

    public ResponseDTO<String> add(StationFindDTO sdto) {

        return ResponseDTO.succ();
    }

    public ResponseDTO<List<StationFindDTO>> getStation(RequestTokenBO requestToken) {
        EmployeeBO employeeBO = requestToken.getEmployeeBO();
        Long id = employeeBO.getId();
        List<StationFindDTO> list = stationDao.getStationByEmpId(id);
        return ResponseDTO.succData(list);
    }
}
